package com.youdoneed.community.shortVideo.dao;

import java.util.List;

import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import com.youdoneed.community.shortVideo.entity.Musiclibrary;
import com.youdoneed.community.shortVideo.entity.Musicrecommend;
import com.youdoneed.community.shortVideo.vo.RecommendVo;
@Mapper
public interface MusicrecommendMapper {
    int deleteByPrimaryKey(String recommendMusicTypeId);

    int insert(Musicrecommend record);

    int insertSelective(Musicrecommend record);

    Musicrecommend selectByPrimaryKey(String recommendMusicTypeId);

    int updateByPrimaryKeySelective(Musicrecommend record);

    int updateByPrimaryKey(Musicrecommend record);
    
    List<RecommendVo> findRecommendMusic(String typeId);
    
    int findRecommendMusicForTotal(String typeId);
    
    Musicrecommend findTheUnique(@Param("musicId") String musicId,@Param("typeId") String typeId);
    
    List<Musiclibrary> findRecommendMusicByName(String name);
    
    int findRecommendMusicByNameForTotal(String name);
    
    List<Musicrecommend> findMusicById(String musicId);
    
    int countByTypeId(String typeId);
    
    List<Musicrecommend> findRecommendMusicByTypeId(String typeId);
    
    int countMusicLibraryRecommend();
    
    List<RecommendVo> findMusiclibraryRecommendMusic();
    
    int findMusiclibraryRecommendMusicForTotal();
    
    List<Musicrecommend> findLibraryRecommendMusic();
    
    List<RecommendVo> findAllRecommend();
    
    Musicrecommend findRecommendMusicBySort(@Param("sort") Integer sort,@Param("typeId") String typeId);
    
    List<RecommendVo> findRecommendMusicByNameAndTypeId(@Param("typeId") String typeId,@Param("name") String name);
    
    int countRecommendMusicByNameAndTypeId(@Param("typeId") String typeId,@Param("name") String name);

    Musicrecommend getFirstMusicRecommand(String typeId);

    int updateSort(@Param("recommendMusicTypeId") String recommendMusicTypeId,@Param("sort") Integer sort);
}